package com.jiazhong.mingxing.boot.boot03.controller;

import org.springframework.web.bind.annotation.*;

// Restful风格的参数问题
@RestController
@RequestMapping("/third")
public class ThirdController {

    //  @RequestMapping(value = "/find",method = RequestMethod.GET)
    @GetMapping("/find1")  //http://localhost:8080/boot03/third/find1?param=admin
    public String find1(@RequestParam("param") String param) {
        return "执行了find方法，参数是:" + param;
    }

    @GetMapping("/find2/{param}") // http://localhost:8080/boot03/third/find2/admin
    public String find2(@PathVariable("param") String param) {
        return "执行了find方法，参数是:" + param;
    }

    @GetMapping("/find3/{name}/{age}")
    public String find3(@PathVariable("name") String name, @PathVariable("age") int age) {
        return "执行了find3方法,参数分别是：" + name + "," + age;
    }
}
